package xhwl.insurance.http.api;

import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.insurance.Constant;
import xhwl.insurance.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by fuyi on 2017/9/28.
 */

public class VideoListApi extends BaseApi {
    VideoListReq req;
    public VideoListApi(String member_id,  String key_word,int page_num){
        req=new VideoListReq(member_id,key_word,page_num);
    }
    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).getVideoList(requestBody);
    }
    private class VideoListReq{
        private String member_id;
        private String key_word;
        private int page_num;

        public VideoListReq(String member_id,  String key_word,int page_num) {
            super();
            this.member_id = member_id;
            this.key_word = key_word;
            this.page_num = page_num;

        }
    }
}
